package com.yourenbang.lingyun.transaction.web.domain.vo.fund;

import com.yourenbang.lingyun.constants.enums.FundBillType;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class UserAccountDetailVO {
    /**
     * 用户id
     */
    private String userBaseId;

    /**
     * 激活返现收入
     */
    private BigDecimal activeEarning;

    /**
     * 达标奖励收入
     */
    private BigDecimal reachEarning;

    /**
     * 推卡奖励收入
     */
    private BigDecimal pushEarning;

    /**
     * 分润奖励收入
     */
    private BigDecimal profitEarning;

    /**
     * 活跃度奖励收入
     */
    private BigDecimal beanEarning;

    /**
     * 总收入
     */
    private BigDecimal totalEarning;



    /**
     * 根据类型set类的值
     * @param type
     * @param earning
     */
    public void setByType(Short type, BigDecimal earning) {
        if (FundBillType.TYPE_110.isEquals(type)) {
            this.activeEarning = earning;
        } else if (FundBillType.TYPE_113.isEquals(type)) {
            this.reachEarning = earning;
        } else if (FundBillType.TYPE_120.isEquals(type)) {
            this.pushEarning = earning;
        } else if (FundBillType.TYPE_170.isEquals(type)) {
            this.profitEarning = earning;
        } else if (FundBillType.TYPE_260.isEquals(type)) {
            this.beanEarning = earning;
        } else {
            return;
        }
        this.totalEarning = totalEarning.add(earning);
    }
}
